#include "process.h"
#include <unistd.h>

#define totle 2048.0
#define one_speed 2.0

void DownLoad(double d_totle, double speed)
{
    double cur = 0;
    while (cur <= d_totle)
    {
        Flushprocess(d_totle, cur);
        if (cur >= d_totle) break;
        //假设在下载数据
        usleep(5000);
        cur += speed;
    }
    printf("\n");
}

int main()
{
    //Process();
    DownLoad(totle, one_speed);
    DownLoad(totle, 5.0);
    DownLoad(totle, 0.0);
    return 0;
}
